import showArea.showArea;

public class NewExceptionTest {
    public  void showArea(double a,double b,double c) throws NewException {
        if (a + b <= c || a + c <= b || b + c <= a)
            throw new NewException("构不成三角形");
        else {
            double p = (a + b + c) / 2;
            System.out.println("面积为" + Math.sqrt(p * (p - a) * (p - b) * (p - c)));
        }
    }
    public static void main(String[] args) throws NewException {
        double sideA=3;
        double sideB=2;
        double sideC=5;
        NewExceptionTest t1=new NewExceptionTest();
            t1.showArea(sideA,sideB,sideC);
    }

}
